import Vue from 'vue'
import Router from 'vue-router'

import Search from "../components/Search"
import SignIn from "../components/SignIn"
import SignUp from "../components/SignUp"

import store from "../store"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Search',
      component: Search
    },
    {
      path: "/SignIn",
      name: "SignIn",
      component: SignIn,
      redirect: store.state.Account.isLogined ? { name: "Search" } : null
    },
    {
      path: "/SignUp",
      name: "SignUp",
      component: SignUp,
      redirect: store.state.Account.isLogined ? { name: "Search" } : null
    }
  ]
})
